/**
 * 
 */
package com.binhthuan.catechist.client.content;

import com.binhthuan.catechist.client.AbstractContent;
import com.binhthuan.catechist.client.ContentFactory;
import com.binhthuan.catechist.client.ECApplication;
import com.binhthuan.catechist.client.ECIcons;
import com.binhthuan.catechist.client.content.manage.ManageSchoolYear;
import com.binhthuan.catechist.shared.Utilities;
import com.smartgwt.client.widgets.Canvas;
import com.smartgwt.client.widgets.Label;

/**
 * @author dttgiang
 * 
 */
public class HomePage extends AbstractContent {

    public static class Factory implements ContentFactory {

        private static Factory instance;
        private String id;

        private Factory() {
            if (id == null) {
                id = Utilities.generateID(HomePage.class.getName());
            }
        }

        /**
         * @return the instance
         */
        public static Factory getInstance() {
            if (instance == null) {
                instance = new Factory();
            }

            return instance;
        }

        /**
         * @param instance
         *            the instance to set
         */
        public static void setInstance(Factory instance) {
            Factory.instance = instance;
        }

        @Override
        public boolean checkCertificated(long securityCode) {
            return true;
        }

        @Override
        public AbstractContent create() {
            return new AbstractContent() {
                
                @Override
                public Canvas getContentPanel() {
                    // TODO Auto-generated method stub
                    Label l = new Label("Home page");
                    return l;
                }
            };
        }

        @Override
        public String getID() {
            return id;
        }

        @Override
        public String getIcon() {
            return ECIcons.getIcon("home.png");
        }

        @Override
        public String getTitle() {
            return ECApplication.getConstants().homePage();
        }
    }

    /**
     * 
     */
    public HomePage() {
        // TODO Auto-generated constructor stub
    }

    @Override
    public Canvas getContentPanel() {
        // TODO Auto-generated method stub
        return null;
    }
}
